using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;

namespace Clue_Less_Client
{
    class Error
    {
        public static void Show(string text, Exception ex) 
        {
            MessageBox.Show(text, "Clue Less Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);

            String sSource;
            string sLog;
            string sEvent;

            sSource = "Clue-Less";
            sLog = "Application";

            if (!EventLog.SourceExists(sSource))
                EventLog.CreateEventSource(sSource, sLog);

            EventLog.WriteEntry(sSource, ex.Message + Environment.NewLine + ex.StackTrace);
        }
    }
}
